package com.ylpms.agme.controller;

import com.ylpms.agme.entity.IndexEntity;
import com.ylpms.agme.service.IndexService;
import com.ylpms.too.AjaxJson;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class IndexController {

    @Autowired
    IndexService indexService;

    @RequestMapping(value = "/addindex")
    public Integer addIndex() {
        return 0;
    }

    @RequestMapping(value = "/getIndex")
    public AjaxJson getIndex(String indexType,int regionid,String cropcode,String time){
        AjaxJson ajaxJson = new AjaxJson();
        IndexEntity indexEntity = indexService.getIndex(indexType,regionid,cropcode,time);
        ajaxJson.setObj(indexEntity);
        return ajaxJson;
    }

    @RequestMapping(value = "/saveIndex")
    public void saveIndex(){}

    

}
